package com.jt.www.enums.issue;

import org.apache.commons.lang.StringUtils;

/**
 * @author xq.wu03
 * @Classname riskCodeEnum
 * @Description 诚泰发票险种映射
 * @create 2020-10-29 17:06
 */
public enum RiskCodeEnum {

    YN_XF("19PR534934", "1203"),

    YN_SP("19PR233356", "1271"),

    YN_JZ("19PR467834", "1280"),

    YN_ZH("19PR452292", "1203");

    private String productCode;

    private String riskCode;

    RiskCodeEnum(String productCode, String riskCode) {
        this.productCode = productCode;
        this.riskCode = riskCode;
    }

    public static String getRiskCode(String productCode) {
        if (StringUtils.isBlank(productCode)) {
            return "";
        }
        for (RiskCodeEnum riskCodeEnum : RiskCodeEnum.values()) {
            if (riskCodeEnum.productCode.equals(productCode)) {
                return riskCodeEnum.riskCode;
            }
        }
        return "";
    }
}
